package org.csmzxy.class2333;

public class 冒泡排序 {
    public static void main(String[] args){
        int[] arr1 = {12,5,20,64,50,30};
        int guodu = 0;
        for (int i = 0; i < arr1.length - 1; i++){
            for (int j = 0 ; j <arr1.length - 1 - i; j++){
                if(arr1[j] > arr1[j+1]){
                    guodu = arr1[j];
                    arr1[j] = arr1[j+1];
                    arr1[j+1] = guodu;
                }
            }
        }
        for (int i = 0 ; i < arr1.length; i++){
            System.out.println(arr1[i]);
        }
    }
}
